window.addEventListener("load", function() {
    let tit = document.querySelectorAll(".nth")
    let p = document.querySelectorAll(".right-column")
    for (let i = 0; i < tit.length; i++) {
        tit[i].setAttribute("index", i)
        tit[i].addEventListener("click", function() {
            for (let i = 0; i < tit.length; i++) {
                p[i].style.display = 'none'
                tit[i].classList.remove('active')
            }
            let index = this.getAttribute("index")
            p[index].style.display = 'block'
            this.classList.add('active')
        })
    }
    var b = document.querySelector('.right-nav')
    window.onscroll = function() {
        if (document.documentElement.scrollTop >= 655) {
            b.style = "display:block"
        } else {
            b.style = "display:none"
        }
    }
    b.onclick = function() {
        document.documentElement.scrollTop = 0
    }
    var zc = document.querySelector('.zc')
    zc.onclick = () => {
        window.location.href = "login2.html"
    }
    var photo = document.querySelector('.logo')
    console.log(photo)
    photo.onclick = function() {
        window.location.href = "frist-page.html";
    }
})